from google.appengine.ext import db

class Greeting(db.Model):
    author = db.UserProperty()
    content = db.StringProperty(multiline=True)
    date = db.DateTimeProperty(auto_now_add=True)
    
class Station(db.Model):
    nom = db.StringProperty()
    enneigement_haut = db.FloatProperty()
    enneigement_bas = db.FloatProperty()
    remonte_total = db.IntegerProperty()
    remonte_ouverte = db.IntegerProperty()
    
    
class User(db.Model):
    id = db.IntegerProperty()
    author = db.UserProperty()
    login = db.StringProperty()
    password = db.StringProperty()
    station = db.ReferenceProperty(Station)
    
    
class Pistes(db.Model):
    station = db.ReferenceProperty(Station)
    type = db.StringProperty(choices=set(["noire", "rouge", "verte", "bleu", "blanche"]))
    etat = db.StringProperty(choices=set(["ouverte", "fermee"]))

class AvisUser(db.Model):    
    station = db.ReferenceProperty(Station)
    vote_general = db.FloatProperty()
    eval_perso = db.StringProperty(multiline=True, choices=set(["rocky", "powder", "artificial snow", "hard", "soup"]))
    eval_libre = db.StringProperty()
    date = db.DateProperty()
    
    